package cate.game.play.skill.passive.guild;

import cate.common.util.XT;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 回合开始前50%概率提升自身15%攻击，如未触发本回合受到的伤害减少9%
 */
public class 灵动九天PH extends PassiveHandler {

	private int 概率;

	private int 成功buff;

	private int 失败buff;

	//概率=5000%成功buff=？失败buff=？
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs();
		概率 = args.getInt("概率", 0);
		成功buff = args.getInt("成功buff", 0);
		失败buff = args.getInt("失败buff", 0);
	}

	@Override
	public void onRoundBegin(ActionCtx action) {
		int buff = XT.chance(概率) ? 成功buff : 失败buff;
		skill.owner.buff.tryAddByTid(action, buff);
	}
}
